
    <div class="content margin_top">
        <header class="header fixed_top bg_mx_green"></header>
        <div class="font_16 margin_b_10 bg_white lineheight_4 text_center flex title_nav">
            <div class="flex_1 <{if is_null($status)}>active_border<{/if}>"><a href="<{url route='/business/user/farmer-house-order/index'}>">全部</a></div>
            <div class="flex_1 <{if $status==='0'}>active_border<{/if}>"><a href="<{url route='/business/user/farmer-house-order/index?status=0'}>">待付款</a></div>
            <div class="flex_1 <{if $status==1}>active_border<{/if}>"><a href="<{url route='/business/user/farmer-house-order/index?status=1'}>">待入住</a></div>
            <div class="flex_1 <{if $status==2}>active_border<{/if}>"><a href="<{url route='/business/user/farmer-house-order/index?status=2'}>">已入住</a></div>
            <div class="flex_1 <{if $status==3}>active_border<{/if}>"><a href="<{url route='/business/user/farmer-house-order/index?status=3'}>">待评价</a></div>
        </div>
        <div class="order_list"></div>
    </div>
    <script type="text/template" charset="utf-8" id='order_template'></script>
    <script>
        // 页面初始化
            var order_list = <{$orderlist}>;console.log(order_list);
            loadorder_hotel(order_list);
            loadheadbar("农家乐订单管理");
        // 取消订单
            function quit_order(n){
                $.post("/business/user/farmer-house-order/cancal",{id:n,_csrf:'<{$app->request->csrfToken}>'},function(res){
                    alert(res.msg);
                    if(res.status==0){
                        window.location.reload()
                    }
                },"json")
            }
        // 支付
            function pay_order(n){
//                $.post("",{id:n,_csrf:'<{$app->request->csrfToken}>'},function(res){
//
//                },"json")
                  location.href='/pay/wechat/pay/index?oid='+n;
            }
        // 确认入住
            function confirm_order(n){
                $.post("/business/user/farmer-house-order/confirm-live",{id:n,_csrf:'<{$app->request->csrfToken}>'},function(res){
                    alert(res.msg);
                    if(res.status==0){
                        window.location.href='/business/user/farmer-house-order/index?status=3';
                    }
                },"json")
            }
        // 评价
            function comment_order(n,oid){
                 location.href = "/farmerhouse/site/comment?hid="+n+'&oid='+oid;
            }
        //游记
            function travel_order(n,oid){
                location.href = "/business/user/farmer-experience/edit?hid="+n+'&oid='+oid;
            }

    </script>


